<?php 
// +---------------------------------------------------------------------------+
// | This file is part of a Book Store project.                                |
// | Copyright (c) 2005-2007 the Bsto Project.                                 |
// |                                                                           |
// | For the full copyright and license information, please view the LICENSE   |
// | file that was distributed with this source code. You can also view the    |
// | LICENSE file online at http://                                            |
// |   vi: set noexpandtab:                                                    |
// |   Local Variables:                                                        |
// |   indent-tabs-mode: t                                                     |
// |   End:                                                                    |
// +---------------------------------------------------------------------------+
// start using session
session_start();
 
// turn on reporting
error_reporting(E_ALL);

// set timezone
date_default_timezone_set('Asia/Ho_Chi_Minh');

// reject directly run
define('IN_BSTO', true);

// define website path
$bstoPath = realpath(dirname(__FILE__));
define ('BSTO_PATH', $bstoPath);

// load init file
include BSTO_PATH . '/application/init.php';

// init Router
$bsto->router = new Router($bsto);

$bsto->admincp = false;

// set debug mode
$bsto->debug = true;

// set controller path
$bsto->router->setPath (BSTO_PATH . '/controller');

// set root path
define('BSTO_ROOT_PATH', $bsto->router->getRoot());

// init Template Engine
$bsto->template = new Template($bsto);

$bsto->db = new DB($bsto);

$bsto->db->startConnection();

// run the app
$bsto->router->loader();

$bsto->db->closeConnection();




//echo BSTO_ROOT_PATH;
/**
 * acceptable bsto URL(FRONT-END SITEMAP)
 *
 * - url/
 * - url/content/services | url/content/aboutus | url/content/privacy
 * - url/book/111
 * - url/cat/12
 * - url/book/7
 * - url/featuredbooks/12 (page) --index
 * - url/specialbooks/13 (page)
 * - url/contactus
 * - url/register 
 * 
 * - url/index.php?act=content/id/services&page=12
 * - url/specbook/page=12/
 * 
 */
 
?>